package other.nowcoder.easy;

import java.util.Scanner;

/**
 * @author bruin_du
 * @description 查找组成一个偶数最接近的两个素数
 * https://www.nowcoder.com/practice/f8538f9ae3f1484fb137789dec6eedb9?
 * tpId=37&&tqId=21283&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
 * @date 2022/5/8 18:26
 **/
public class TwoPrimeClosestToEvenNum {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int num = in.nextInt();
            int halfNum = num / 2;
            int lNum = halfNum,sNum = halfNum;
            while(sNum > 0 && lNum < num){
                if(judgeSuShu(lNum) && judgeSuShu(sNum)){
                    System.out.println(sNum);
                    System.out.println(lNum);
                    break;
                }
                sNum--;
                lNum++;
            }
        }
    }
    private static boolean judgeSuShu(int num){
        int sqrt = (int)Math.sqrt(num);
        for(int i = sqrt;i > 1; i--){
            if(num % i == 0)
                return false;
        }
        return true;
    }
}
